<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.6.0.js"></script>
    <style>
        div.box {
            width: 500px;
            height: 200px;
            background-color: pink;
        }
    </style>
</head>

<body>
    <form name="myform">
        <p>速度</p>
        <input type="radio" name="speed" value="slow"> slow
        <input type="radio" name="speed" value="normal"> normal
        <input type="radio" name="speed" value="fast"> fast
        <input type="number">ms
        <br>
        <p>动画效果</p>
        <input type="radio" name="easing" value="swing"> swing
        <input type="radio" name="easing" value="linear"> linear
        <br>
        <p>透明度切换</p>
        <input type="range" min="0" min="1" id="ocy"><input id="showOcy" type="number">
    </form>
    <p></p>
    <button data-type="show">显示</button>
    <button data-type="hide">隐藏</button>
    <button data-type="toggle">切换</button>
    <button data-type="opacity">透明度切换</button>
    <p></p>
    <div class="box"></div>
    <script>
        $('#ocy').change(function() {
            $('#showOcy').value = this.value;
        })
        $('button').click(function() {
            let type = this.dataset.type;
            let elements = document.forms.myform.elements;
            // console.log(elements.speed);
            // console.log(elements.easing);
            let speed = elements.speed.value;
            let easing = elements.easing.value;
            //透明度显示栏
            //透明度拉动

            if (type === 'show') {
                $('div').show(speed, easing)
            } else if (type === 'hide') {
                $('div').hide(speed, easing)
            } else if (type = 'toggle') {
                $('div').toggle(speed, easing)
            } else if (type = 'opacity') {}



        })
    </script>

</html>